import React = require("react");
import { Component, ComponentData } from "maishu-jueying";
import { pageDatas } from "services/page-datas";
import { loadComponents } from "mobile/site";
import { SpinerComponent, SpinerState } from "controls/spiner-component";

interface State extends SpinerState {
    pageData: ComponentData
}

export default class UserIndexPage extends SpinerComponent<{}, State> {
    async loadData() {
        let pageData = (await pageDatas.member()).pageData;
        await loadComponents(pageData);
        return { pageData };
    }
    render() {
        let pageData = this.state.pageData;
        return Component.createElement(pageData);
    }
}